﻿using System;
using UnityEngine;

namespace Yoozoo.Core.Common
{
    /// <summary>
    /// 根据当前质量等级，开关Behaviour
    /// </summary>
    public class BehaviourEnableQualityListener : QualityListenerMono<BehaviourEnableQualityListener.BehaviourEnableSetting>
    {
        public Behaviour Behavior;

        [Serializable]
        public class BehaviourEnableSetting : QualitySetting
        {
            public bool IsEnable;
        }

        public override void ChangeQualitySetting(BehaviourEnableSetting qualitySetting)
        {
            if (Behavior == null)
                return;
            
            Behavior.enabled = qualitySetting.IsEnable;
        }
    }
}
